package com.person.android.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.baidu.mobstat.StatService;
import com.person.android.formatts.R;

/**
 * @autor zhaokang.
 * @time on 2015/12/18.
 */
public class AboutFormatActivity extends Activity implements View.OnClickListener {

    private TextView mHeaderTv;
    private ImageView mBackImv;                 //返回箭头
    private RelativeLayout mHeaderContainer;    //header容器

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        findViewsAndInitialUI();
        setListenersForWidgets();
    }

    private void setListenersForWidgets() {
        mBackImv.setOnClickListener(this);
        mHeaderContainer.setOnClickListener(this);
    }

    private void findViewsAndInitialUI() {
        mBackImv = (ImageView) findViewById(R.id.ibv_back);
        mHeaderContainer = (RelativeLayout) findViewById(R.id.header_container);
        (mHeaderTv = (TextView) findViewById(R.id.header_txt)).setText(R.string.activity_soft_about);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ibv_back:
            case R.id.header_container:
                finish();
                break;
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        StatService.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        StatService.onPause(this);
    }
}
